
package com.flashextended.apps.logomaker.view.header
{
	import com.flashextended.apps.logomaker.controlers.Controlers;
	import com.flashextended.apps.logomaker.singleton.AppLocales;
	
	import flash.display.Bitmap;
	
	import mx.containers.HBox;
	import mx.controls.Spacer;
	import mx.core.UIComponent;

	public class Header extends HBox
	{
	    [Embed(source="../assets/images/info.png")]
	    private var Info:Class;
	    private var infoUI:UIComponent;
		
		[Embed(source="../assets/applogo/logo.png")]
		private var AppLogo:Class;	
	    		
		public function Header()
		{
			super();
			settings();
			var logoUI:UIComponent = new UIComponent();
			logoUI.addChild(new AppLogo());
			this.addChild(logoUI);
			var sp:Spacer = new Spacer();
			sp.percentWidth = 100;
			this.addChild(sp);
			infoUI = constructInfo();
			infoUI.toolTip = AppLocales.getInstance().data.locales["info"];
			this.addChild(infoUI);
			Controlers.getInstance().addMouseAction(infoUI, Controlers.getInstance().infoListener);			
		}
		
		private function settings():void
		{
			this.percentWidth = 100;
			this.height = 70;
			this.setStyle("backgroundColor", 0x274996);
		}
		
		private function constructInfo():UIComponent
		{
			var ui:UIComponent = new UIComponent();
			var bmp:Bitmap = new Info();
			ui.addChild(bmp);
			ui.width = bmp.width;
			ui.height = bmp.height;
			ui.buttonMode = true;
			return ui;
		}			
		
	}
}